import numpy as np
import math
import torch

# magnitude长度和方向
v = np.array([2,1])
print('magnitude:',((v[0] ** 2 + v[1] ** 2) **(1/2) ))
print('direction:',math.tanh(1/2))

#sum运算
a = torch.tensor([
    [1,2,3],
    [4,5,6]
])
print(torch.sum(a,axis=0))
